pkgname=trinity-static-x86_64
pkgver=git
pkgrel=1
arch=('i386' 'x86_64')
url="https://github.com/kernelslacker/trinity"
license=('GPL')
makedepends_debian_11=(autopoint debhelper dh-autoreconf dh-strip-nondeterminism gettext gettext-base groff-base intltool-debian libarchive-zip-perl libcroco3 libfile-stripnondeterminism-perl libicu67 libpipeline1 libtimedate-perl libxml2 man-db po-debconf gcc-multilib)
source=("https://github.com/kernelslacker/trinity.git")
md5sums=('SKIP')

build() {
	export CC="gcc -static"
	gcc_major=$($(which gcc) -dumpversion | cut -d. -f1)
	cd "$srcdir/trinity" || return
	./configure || return
	if [[ "$gcc_major" -ge 8 ]]; then
		CFLAGS="-Wno-address-of-packed-member -Werror=format-overflow=0" make
	else
		make
	fi

	make install
}

package() {
	cd "$srcdir/trinity" || return
	benchmark_path="${pkgdir}/lkp/benchmarks/${pkgname}"
	bin_path="${pkgdir}/bin"
	mkdir -p $benchmark_path
	mkdir -p $bin_path
	cp /bin/trinity $bin_path
	INSTALL_PREFIX=$benchmark_path make install
}
